// Copyright (C) 1997, 1999-2001, 2008 Nathan Lamont
// Copyright (C) 2008-2012 The Antares Authors
//
// This file is part of Antares, a tactical space combat game.
//
// Antares is free software: you can redistribute it and/or modify it
// under the terms of the Lesser GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Antares is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with Antares.  If not, see http://www.gnu.org/licenses/

#ifndef ANTARES_LANG_CASTS_HPP_
#define ANTARES_LANG_CASTS_HPP_

#include <cstddef>

namespace antares {

template <typename To, typename From>
To implicit_cast(const From& from) {
    return from;
}

template <typename Derived, typename Base>
Derived down_cast(const Base& base) {
    if (false) {
        Derived* d = NULL;
        Base* b = d;
        static_cast<void>(b);
    }
    return reinterpret_cast<Derived>(base);
}

}  // namespace antares

#endif  // ANTARES_LANG_CASTS_HPP_
